<!DOCTYPE html>
<html>
<head>
    {include file='public/meta'/}
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/tidy.css"/>


</head>
<body>
{include file='public/header'/}
<section>
    <!------------------导航-------------------------->
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgl15 mgr15">
            <ul class="breadcrumb">
                <li>
                    当前位置是&nbsp;:&nbsp;
                </li>
                <li><a href="{:url('cardus/cardinfo',['card_id'=>$card['card_id']])}">会员卡管理</a></li>
                <li>
                    <a href="{:url('shop/shopmall',['card_id'=>$card['card_id']])}"> 积分商城</a>
                </li>
                <li class="active" style="color: #02b87f;"> 订单列表</li>
            </ul>
        </div>
        <div class="mgl15 mgr15">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h5 class="panel-title">条件筛选</h5>
                </div>
                <div class="panel-body">
                    <form action="" method="get" class="form-horizontal table-search form-search" role="form" id="machform">
                        <div class="col-sm-6 col-md-4 col-lg-4 col-slg-4">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">商品名称：</label>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="goods_name" placeholder="请输入" value="{$p_data['goods_name']}" name="goods_name">
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6 col-md-4 col-lg-4 col-slg-4">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">订单状态：</label>
                                <div class="col-sm-9">
                                    <select name="statu" id="statu" class="form-control">
                                        <option value="">请选择</option>
                                        <option value="0" {if condition = "$p_data['statu'] eq '0'"}selected{/if}>正常</option>
                                        <option value="1" {if condition = "$p_data['statu'] eq '1'"}selected{/if}>关闭</option>
                                        <option value="2" {if condition = "$p_data['statu'] eq '2'"}selected{/if}>完成</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-4 col-lg-4 col-slg-4">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">兑换时间：</label>
                                <div class="col-sm-9">
                                    <input name="search_date" type="text" value=""
                                           readonly="readonly" id="search_date" class="form-control"
                                           placeholder="请选择" style="width: 297px">

                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="panel-footer">
                    <a href="javascript:;" class="btn btn-primary" onclick="searchform()">查找</a>
                    <a href="javascript:;" class="btn btn-default" onclick="clearform()">清空</a>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h5 class="panel-title">
                        数据分析
                    </h5>
                </div>
                <div class="panel-body">
                    <ul class="fenxilist clearfix">
                        <li class="col-sm-3">
                            <div>商品数(个)</div>
                            <div>{$sume.goods}</div>
                        </li>
                        <li class="col-sm-3">
                            <div>订单数(个)</div>
                            <div>{$sume.order}</div>

                        </li>
                    </ul>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading" style="position:relative;">

                    {if condition="checkPath('shop/goodslist')"}
                    <a href="{:url('shop/goodslist',['card_id'=>$card['card_id']])}" class="btn btn-default" >商品管理</a>
                    {/if}

                    <a href="{:url('shop/catelist',['card_id'=>$card['card_id']])}" class="btn btn-default" >类目管理</a>

                    {if condition="checkPath('shop/orderlist')"}
                    <a href="{:url('shop/orderlist',['card_id'=>$card['card_id']])}" class="btn btn-default" >订单管理</a>
                    {/if}

                </div>

            </div>
            <div class="panel panel-default">
                <div class="panel-heading" style="position:relative;">
                    <h5 class="panel-title">
                        订单列表
                    </h5>
                </div>
                <div class="panel-body">
                    <table class="table table-bordered" id="tableExcel">
                        <thead>
                        <tr>

                            <th>编号</th>
                            <th>商品名称</th>
                            <th>兑换积分</th>
                            <th>兑换数量</th>
                            <th>订单状态</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="orderlist" id="vo"}
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.goods_name}</td>
                            <td>{$vo.price}</td>
                            <td>{$vo.number}</td>
                            <td>
                                {switch name="$vo.statu"}
                                {case value="0"}正常{/case}
                                {case value="1"}关闭{/case}
                                {case value="2"}完成{/case}
                                {/switch}
                            </td>
                            <td>{$vo.create_time}</td>
                            <td class="chakan">
                                {if condition="checkPath('shop/goodslist')"}
                                <a class="btn-link" href="{:url('shop/orderinfo',['id'=>$vo['id'],'card_id'=>$card['card_id']])}">详情</a>
                                {/if}
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                {$orderlist->render()}
            </div>
        </div>
        {include file='public/footer'/}
    </div>
</section>
</body>
<script src="__STATIC_URL__/static/laydate/laydate.js"></script>

<script type="text/javascript">

    //执行一个laydate实例
    // var s=laydate.now();
    laydate.render({
        elem: '#search_date',
        type: 'datetime',
        range: true,
        change: function (value, date, date2, data3) {
            var s = value.split(" - ");
            var startdate = new Date(s[0]).getTime();
            var enddate = new Date(s[1]).getTime();
            var ldate = Math.floor((enddate - startdate) / (24 * 3600 * 1000));
            if (ldate > 30) {
                layer.alert("日期区间不能大于31天");
                $("#search_date").val("");
            }
        }
    });


</script>

</html>
